package com.atguigu.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.Arrays;
import java.util.Map;

/**
 * @Description
 * @Author codingBee
 * @Date 2020/4/17/19:45
 */
@Controller
public class HelloController {
    @GetMapping("/success")
    public String success(Map<String,Object> map){
        map.put("hello","<h1>hello</h1>");
        //相当于去classpath:/templates/ 路径下找文件名为： success + ".html" 的页面
        map.put("users", Arrays.asList("<h1>zhangsan</h1>","lisi","wangwu"));
        return "success";
    }
//    @GetMapping({"/","/index.html"})
//    public String index(){
//      return "index";
//    }
}
